<?php
	$id = request('id');
	if(!$id || !is_numeric($id))exit('data error');
	require_once("header.php");
	//设备信息
	$object=new device();
	$record=$object->get_device_info($id);
	if(empty($record))exit('data error');
	//绑定信息
	$bindinfo=$object->bind_list($id);
	//项目信息
	$pobject=new project();
	$pinfo=$pobject->info($bindinfo[0]['pid'],'id,title');
?>

	<script type="text/javascript" charset="utf-8">
		loader.file({
			plugin:['validform/main','dialog/main','my97/wdatepicker'],
			skincss:['list']
		})
		
		function nouse(id){
		       if(!confirm('确认设置记录为无效 ？')){
		            return false;
		       }

		       $.getJSON('/handle.php',{id:id,h:'project/nouse'},function(res){
		           if(res.state){
		                 $("#no_"+id).remove();
		                 return false;
		           }
		           alert(res.msg);
		       });       
		}		
	</script>
	<style type="text/css">
		.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
		.goodimg{width:280px;background: #efefef none repeat scroll 0 0;border: 1px solid #aad381;}
		.table li{float:left;margin-right: 10px;margin-top: 10px;text-align: center;}
		.table img{margin:5px;}
		.table .text{text-align:left;margin-left:10px;}
		.table .operation{background:#aad381}		
	</style>	
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/edit">
      <input type="hidden" name="id" value="<?php echo $id?>">
		<table cellpadding="0" cellspacing="1" border="0" class="table">
		    <tr>
		       <td colspan="2">
				   <p>
				                设备号：<strong><?php echo $record['no']?></strong> (ID:<?php echo $record['id']?>)&nbsp;&nbsp;
				                添加时间：<strong><?php echo date('Y-m-d H:i:s',$record['time'])?></strong>          
				   </p>
				   <?php if($record['update']){ ?>
				   <p>				   				   				     
				      编号变更时间：<font color="red"><?php echo date('Y-m-d H:i:s',$record['update'])?></font>
				   <a href="/data/logs/<?php echo date('Ymd',$record['update'])?>_nochange.txt" target="_blank">查看变更日志</a>   			     
				   </p>   				   
				   <?php }?>				   		      
		       </td>
		    </tr>
		    <tr><td>
			   <p>
			               项目名称：<strong><?php echo $pinfo['title']?></strong> (ID:<?php echo $pinfo['id']?>)&nbsp;&nbsp;
			                绑定时间：<strong><?php echo date('Y-m-d H:i:s',$bindinfo[0]['time'])?></strong>          
			   </p>		
			   <p>
			               绑定号：<strong><?php echo $bindinfo[0]['id']?></strong><br/>
			               车牌号：<strong><?php echo $bindinfo[0]['car_number']?></strong><br/>
                                       产权人：<strong><?php echo $bindinfo[0]['link_man']?></strong><br/>			                
                                       车型：<strong><?php echo $bindinfo[0]['cartype']?></strong><br/>
                                       驾驶员：<strong><?php echo $bindinfo[0]['doper']?></strong><br/>
                                       电话：<strong><?php echo $bindinfo[0]['phone']?></strong><br/>
			   </p>			     
			      
			</td></tr>			
		</table>
	</form>	
	</div>
</body>
<script type="text/javascript" src="/static/js/jquery.lazyload.js"></script>
<script type="text/javascript">
$(function(){    
    $("img.lazy").lazyload({effect:"fadeIn"});
});
</script>
</html>